package com.spcloud.fegin.fegin;

import com.spcloud.common.entity.Order;
import com.spcloud.fegin.fegin.impl.OrderServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;

import javax.print.attribute.standard.MediaSize;
import java.util.List;

/**
 * 定义fegin Api
 * @author GuoChunbo
 * @create 2020-03-11 8:53
 * @Description: 类的描述
 */
//指定服务名称 8082,8092 ,指定失败回调
@FeignClient(name = "service-order",fallback = OrderServiceImpl.class)
public interface OrderService {

    //定义调用服务的接口   必须和服务接口一致，请求映射、返回值、参数
    @GetMapping("/info")
    String info() throws RuntimeException;

    @GetMapping("/list")
    List<Order> getOrderList() throws RuntimeException;
}
